<template>
	<div id="det_app">
		<div class="det">
			<div class="details_img">
				<!--<img src="https://pic.maizuo.com/usr/movie/8ac6534a9c16f05e454b98926523e6d4.jpg" />-->
				<img :src="film.poster.origin"/>
			</div>
			<div class="det_word">
				<div class="det_word_title">
					<div class="bt_span"></div>
					<div class="bt_wenzi">
						<span class="movie_info">
							影片简介
						</span>
					</div>
					<div><span class="det_nn">导&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;演：</span>{{film.category}}</div>
					<div><span class="det_nn">主&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;演：</span><em v-for="item in film.actors">{{item.name}}&nbsp;</em></div>
					<div><span class="det_nn">地区语言：</span>{{film.language}}</div>
					<div><span class="det_nn">上映日期：</span>{{getLocalTime(film.premiereAt)}}</div>
					<div class="det_nn">{{film.synopsis}}</div>
				</div>
			</div>
		</div>
		<div class="ticket">
			立即购票
		</div>
	</div>
</template>

<script>
	import axios from "axios";

	export default {
		mounted: function() {
			var self = this;
			var urls = "https://m.maizuo.com/v4/api/film/" + this.$route.query.id;
			axios.get(urls).then(function(res) {
				console.log(res.data.data);
				self.film = res.data.data.film;
//				self.img_det = res.data.data.film.poster;

			}).then(function(err) {
				console.warn(err);
			});
		},

		data: function() {
			return {
				id: 0,
				name: "",
				film: {},
				poster:{},
			}
		},
		methods: {
			//时间戳
			getLocalTime: function(nS_time) {
				var d=new Date(nS_time);
				d.getFullYear();
				//从月份0开始
				d.getMonth()+1;
				d.getDate();
				
				return d.getFullYear()+"/"+d.getMonth()+1+"/"+d.getDate();
				//return new Date(parseInt(nS_time) * 1000).toLocaleString().replace(/年|月/g, "-").replace(/日/g, " ");
			},
		}
	}
</script>

<style lang="scss">
	@import "../scss/details.scss";
</style>